package com.sinaapp.mrblog.game.Assasin.model;

import com.badlogic.gdx.Gdx;
import com.sinaapp.mrblog.game.Assasin.util.AssasinConst;

public abstract class BaseButton extends BaseActor {

	public static final int TOUCH_UP = 0;
	public static final int TOUCH_DOWN = 1;
	
	
	public int pointIndex = -1;

	public boolean isNewTouch;
	int relateKey;
	boolean isPressed;

	public BaseButton(float x, float y, float width, float height) {
		super(x, y, width, height);
		alpha = AssasinConst.BUTTON_ALPHA;
	}

	public void processkey() {
		if (!isNewTouch) {
			if (Gdx.input.isKeyPressed(relateKey)) {
				if (!isPressed) {
					isNewTouch = true;
					isPressed = true;
				}
			} else {
				isPressed = false;
				isNewTouch = false;
			}
		}
	}

	@Override
	public void act(float delta) {
		isNewTouch = false;
		super.act(delta);
	}
	
	

}
